<?php /*a:3:{s:68:"D:\phpstudy_pro\WWW\xiaomu\tp\app\admin\view\web\webadmin\index.html";i:1725440104;s:56:"D:\phpstudy_pro\WWW\xiaomu\tp\app\admin\view\layout.html";i:1725115306;s:62:"D:\phpstudy_pro\WWW\xiaomu\tp\app\admin\view\common\table.html";i:1724490455;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>欢迎使用小木CMS内容管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <link rel="stylesheet" href="/zhcms/layui_v2_9_10/css/layui.css" media="all">
    <link rel="stylesheet" href="/zhcms/style.css?v=<?php echo time();?>" media="all">

    <script src="/zhcms/jquery/jquery-3.6.0.min.js" charset="utf-8"></script>
    <script src="/zhcms/layui_v2_9_10/layui.js" charset="utf-8"></script>

</head>
<body>
<blockquote class="layui-elem-quote">
  文章分类管理
</blockquote>

<div class="layui-btn-container mt15 mb15">

    <button type="button" class="layui-btn layui-btn-radius" onclick="refresh()">刷新</button>
    <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" id="add">添加</button>
    <!-- <button type="button" class="layui-btn layui-btn-danger layui-btn-radius">删除</button> -->

</div>

<style>
    .main{
        display:flex;
        overflow: hidden;
    }
    .main-left{
        width:100px;
        box-shadow: 0 0 10px rgba(0,0,0,0.3);
        z-index: 2;
    }

    .main-mid{
        flex:1;
        overflow-x:scroll;
    }

    .main-right{
        width:150px;
        box-shadow: 0 0 10px rgba(0,0,0,0.3);
        z-index: 2;
    }

    .inner{
        height:60px;
        display: flex;
        align-items: center;
    }
    .usericon{
        height:50px;
        width:50px;
        border-radius: 25px;
        display: block;
        margin:5px;
    }

    .layui-table td{
        height:60px;
    }
</style>

<div class="main">

  <div class="main-left">
      <table class="layui-table" style="margin:0" lay-even>
          <thead>
            <tr>
              <th>ID</th>
            </tr> 
          </thead>
          <tbody>
              <?php if(is_array($cate_list) || $cate_list instanceof \think\Collection || $cate_list instanceof \think\Paginator): $i = 0; $__LIST__ = $cate_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
              <tr>
                  <td><?php echo htmlentities((string) $vo['id']); ?></td>
              </tr>
              <?php endforeach; endif; else: echo "" ;endif; ?>
          </tbody>
      </table>
  </div>

  <div class="main-mid">
      <table class="layui-table" style="width:2000px ;margin:0" lay-even>
      <thead>
        <tr>
          <th>分类名称</th>
          <th>别名</th>
          <th>启用模板</th>
          <th>父级ID</th>
          <th>排序</th>
          <!-- <th>分类图片</th> -->
          <th>是否显示</th>
          <th>关键词</th>
          <th>描述</th>
          <th>创建时间</th>
        </tr> 
    </thead>
    <tbody>
      <?php if(is_array($cate_list) || $cate_list instanceof \think\Collection || $cate_list instanceof \think\Paginator): $i = 0; $__LIST__ = $cate_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
        <tr>
            <td><?php echo htmlentities((string) $vo['category_name']); ?></td>
            <td><?php echo htmlentities((string) $vo['alias']); ?></td>
            <td><?php if($vo['tempstatus'] == 1): ?>启用<?php else: ?>未启用<?php endif; ?></td>
            <td><?php echo htmlentities((string) $vo['parent']); ?></td>
            <td><?php echo htmlentities((string) $vo['sort']); ?></td>
            <td>
              <form class="layui-form" action="">
                  <input type="checkbox" name="open" lay-skin="switch" lay-filter="switchTest" title="显示|隐藏" <?php if($vo['isshow'] == 1): ?>checked<?php endif; ?> >
              </form>
            </td>
            <td><a href="javascript:void(0)" title="<?php echo htmlentities((string) $vo['keywords']); ?>"><?php echo htmlentities((string) $vo['keywords_short']); ?>...</a></td>
            <td><a href="javascript:void(0)" title="<?php echo htmlentities((string) $vo['descriptions']); ?>"><?php echo htmlentities((string) $vo['descriptions_short']); ?>...</a></td>
            <td><?php echo htmlentities((string) $vo['create_time']); ?></td>
        </tr>
     <?php endforeach; endif; else: echo "" ;endif; ?>

    </tbody>
  </table>
  </div>

  <div class="main-right">
    <table class="layui-table" style="margin:0" lay-even >
        <thead>
          <tr>
            <th>操作</th>
          </tr> 
        </thead>
        <tbody>
          <?php if(is_array($cate_list) || $cate_list instanceof \think\Collection || $cate_list instanceof \think\Paginator): $i = 0; $__LIST__ = $cate_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
            <tr>
              <td>
                <div class="layui-btn-group">
                  <button type="button" class="layui-btn layui-btn-sm layui-bg-blue js-open" data-id="<?php echo htmlentities((string) $vo['id']); ?>">修改</button>
                  <!-- <button type="button" class="layui-btn layui-btn-sm layui-bg-red">删除</button> -->
                </div>
              </td>
            </tr>
          <?php endforeach; endif; else: echo "" ;endif; ?>
        </tbody>
    </table>
  </div>

</div>


<div id="laypage" style="text-align: center;"></div>


  
  <script>

  layui.use(function(){
    var laypage = layui.laypage;
    // 普通用法
    laypage.render({
      elem: 'laypage',
      count: "<?php echo htmlentities((string) $total); ?>",// 数据总数
      curr:"<?php echo htmlentities((string) $page); ?>"
    });

    $("#laypage a").on("click",function(){
      var page = $(this).attr("data-page");
      window.location.href="<?php echo url('web.webadmin/index'); ?>?page="+page
    })
  });



    var refresh = ()=>{
      window.location.href="<?php echo url('web.webadmin/index'); ?>";
    }

    $(function(){

      $("#add").on("click",function(){

        layer.open({
          type: 2,
          offset:"t",
          area: ['900px', '550px'],
          title:"添加文章分类",
          content: "<?php echo url('web.webadmin/add'); ?>",
          fixed: false, // 不固定
          maxmin: true,
          shadeClose: true,
        });
      })


      $(".js-open").on("click",function(){
        var id = $(this).attr("data-id");

        layer.open({
          type: 2,
          offset:"t",
          area: ['900px', '520px'],
          title:"修改分类",   
          content: "<?php echo url('web.webadmin/edit'); ?>?id="+id,
          fixed: false, // 不固定
          maxmin: true,
          shadeClose: true,
        });

      })

})



layui.use(['form'], function(){
    var form = layui.form;
    var layer = layui.layer;
    
    // 指定开关事件
    form.on('switch(switchTest)', function(data){
      // layer.msg('开关 checked：'+ (this.checked ? 'true' : 'false'), {
      //   offset: '6px'
      // });
      // layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是 ON|OFF', data.othis)
    });
})

  </script>
</body>
</html>